﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


class Program
{

    static string ReturnFileContents(string filePath)
    {
        string result = string.Empty;
        using (StreamReader file = new StreamReader(filePath))
        {
            while (file.ReadLine() != null)
            {
                result += file.ReadLine();
            }
        }

        return result;
    }

    static void Main()
    {
        string filePath1 = @"..\..\txt1.txt";
        string filePath2 = @"..\..\txt2.txt";
        string filePathResult = @"..\..\txt3.txt";

        string result = "";
        result = ReturnFileContents(filePath1) + ReturnFileContents(filePath2);


        //Console.WriteLine(result);
        using (StreamWriter saveResult = new StreamWriter(filePathResult))
        {
            saveResult.AutoFlush = false;
            saveResult.Write(result);
        }

        Console.WriteLine(ReturnFileContents(filePathResult));
    }
}

